package cn.zpro.jeecg.mvc.util;

import java.lang.reflect.Method;

import javax.servlet.http.HttpServletRequest;

/**
 * 反射工具类
 * 
 * @author zhanggl
 * 
 */
public class InvokeHelper {

	public Object invokeMethod(String classPathName, String methodName,HttpServletRequest req) {
		Class<?> d = null;
		try {
			d = Class.forName(classPathName);
			Method method = d.getMethod(methodName,HttpServletRequest.class);
			// 调用Person的sayHello方法
			Object result = method.invoke(d.newInstance(),req);
			return result;

		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return null;
	}
}
